package com.shuyun.jcss;

import com.shuyun.jcss.tianji.sdk.client.TianjiManager;
import com.shuyun.motor.common.cons.PropsUtil;
import com.shuyun.motor.configuration.ConfigurationManager;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.util.Assert;

/**
 * @Description:
 * @Author: shuai.chen@shuyun.com
 * @Date: 2021/6/9 5:33 下午
 */
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        // 老：在启动方法中，进行配置中心初始化
        ConfigurationManager.initialize();
        System.out.println("从旧配置中心读取system.rabbit.address: " + PropsUtil.getSysOrEnv("system.rabbit.address"));
        // Assert.notNull(PropsUtil.getSysOrEnv("system.rabbit.address"), "system.rabbit.address 不为 null");

        // 新配置中心   在启动方法之前调用
        // TianjiManager.initialize();
        System.out.println("从新配置中心读取name: " + PropsUtil.getSysOrEnv("name"));

        SpringApplication.run(Application.class, args);
    }

}
